<template>
  <div>
    <h2>当前计数：{{ $store.state.count }}</h2>
    <button @click="$store.commit('increment')">+1</button>
    <button @click="$store.commit('decrement')">-1</button>
    <button @click="$store.commit('updateState', 520)">520</button>
  </div>
  <hr />
  <div>
    <button @click="increment">+1</button>
    <button @click="decrement">-1</button>
    <button @click="updateState(520)">520</button>
  </div>
</template>

<script>
//25 start
import { mapMutations } from "vuex";
export default {
  setup() {
    const storeMutations= mapMutations(['increment','decrement','updateState']) 
    return {
      ...storeMutations
    }
  },
};
</script>

<style lang="scss" scoped>
</style>